﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SWENAssignment.Sophia
{
    public partial class editCustomersDetails1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           lblCustomerID.Text = Request.QueryString["customerID"];
           if (!IsPostBack)
           {
               tbxContactNo.Text = Request.QueryString["contactNo"];
               tbxAddress.Text = Request.QueryString["address"];
               tbxEmail.Text = Request.QueryString["email"];
               
           }
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            customersDetails c = new customersDetails();
            c.CustomerID = lblCustomerID.Text;
            c.ContactNo = Convert.ToInt32(tbxContactNo.Text);
            c.Address = tbxAddress.Text;
            c.Email = tbxEmail.Text;
            DBmanager.updateCustomersDetails(c);

            Server.Transfer("~/Sophia/showCustomersDetails.aspx?");
        }
    }
}